Skip to content

Use popup token ranges for autocomplete insertion - #31190

Merged
charliemarsh-oai merged 1 commit into
mainfrom
charlie/autocomplete-target-ranges
Jul 6, 2026
Merged

Use popup token ranges for autocomplete insertion#31190
charliemarsh-oai merged 1 commit into
mainfrom
charlie/autocomplete-target-ranges

Conversation

@charliemarsh-oai

@charliemarsh-oai charliemarsh-oai commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Autocomplete popup synchronization already identifies the active token's range and query, but accepting a result previously discarded that range and independently recomputed token boundaries around the cursor. Those calculations could disagree at ambiguous cursor positions. For example, in @first| @second (with | marking the cursor at the intervening space), the popup targets @second, while the old acceptance path replaces @first.

This threads the active range through legacy file search, skill mentions, and mentions-v2 completion. File, image, and mention insertion now replace the same token that supplied the popup query, and image completion reuses the shared file insertion path.

Stack

This is PR 1 of 3. #31191 builds separator and dismissal behavior on these explicit replacement ranges, and #30463 then fixes token affinity between adjacent mentions.

@fcoury-oai fcoury-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exercised the happy path and it worked as expected. Code looks good, approved 👍

@charliemarsh-oai
charliemarsh-oai merged commit d847857 into main Jul 6, 2026
35 checks passed
@charliemarsh-oai
charliemarsh-oai deleted the charlie/autocomplete-target-ranges branch July 6, 2026 21:48
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants